/**
 * 全站路由配置
 *
 * 建议:
 * 1. 代码中路由统一使用name属性跳转(不使用path属性)
 */
import Vue from 'vue';
import Router from 'vue-router';



Vue.use(Router);

// 开发环境不使用懒加载, 因为懒加载页面太多的话会造成webpack热更新太慢, 所以只有生产环境使用懒加载
const _import = require('./import-' + process.env.NODE_ENV);

// 全局路由(无需嵌套上左右整体布局)
let mainRoutes = [
	{ path: '/', component: _import('main'), name: 'main', meta: { title: ' main' } },
	{ path: '/detail', component: _import('detail'), name: 'detail', meta: { title: ' 水果详情' } },
	{ path: '/settlement', component: _import('settlement'), name: 'settlement', meta: { title: '提交订单' } },
	{ path: '/addressEditing', component: _import('addressEditing'), name: 'addressEditing', meta: { title: '编辑地址' } },
	{ path: '/changePassword', component: _import('changePassword'), name: 'changePassword', meta: { title: '修改密码' } },
	{ path: '/addressList', component: _import('addressList'), name: 'addressList', meta: { title: '地址列表' } },
	{ path: '/orderList', component: _import('orderList'), name: 'orderList', meta: { title: '订单列表' } },
	{ path: '/orderDetail', component: _import('orderDetail'), name: 'orderDetail', meta: { title: '订单详情' } }
];
const router = new Router({
	mode: 'hash',
	scrollBehavior: () => ({ y: 0 }),
	routes: mainRoutes
});





export default router;
